<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>修改视频</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/jquery-1.11.0.js"></script>
<link rel="stylesheet" type="text/css" href="/PHPUnion/Home/Lib/Pintuer/pintuer.css" />
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/pintuer.js"></script>
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/respond.js"></script>
	<script type="text/javascript" src="/PHPUnion/Home/Lib/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" type="text/css" href="/PHPUnion/Home/Lib/uploadify/uploadify.css" />

	<style type="text/css">
	.video-padding{
		padding-left:15%;
		padding-top:8%;
	}
	.Edit-Video-Button{
		width:120px;
	}
	</style>
</head>
<body>
	<div class="container-layout">
		<div class="text-right border margin-little-bottom margin-top padding-right padding-top padding-bottom">
			<button type="button" onClick="location.href='<?php echo U('show', array('cid'=> $_GET['cid']));?>'" class="button bg-sub radius-none">
				<i class="icon-th-list"></i>
				视频列表
			</button>
			<button type="button" onClick="location.href='<?php echo U('EditVideo', array('cid'=> $_GET['cid'],'vid'=> $_GET['vid']));?>'" class="button radius-none bg">
				<i class="icon-edit"></i>
				修改视频
			</button>
		</div>
	</div>
<div class="container-layout">
	<form action="<?php echo U('EditVideo');?>" class="form-auto" method="POST" enctype="multipart/form-data">
		<input type="hidden" name="vid" value="<?php echo ($_GET['vid']); ?>" />
		<div class="line">
			<!-- 左侧 -->
			<div class="x8">
				<table class="table table-hover table-bordered">
					<tr>
						<td width="150" align="right">视频标题</td>
						<td>
							<input type="text" name="title" value="<?php echo ($field["title"]); ?>" class="input input-small" size="45" />
							<label><input type="checkbox" name="new_window" <?php if($field['new_window'] == 1): ?>checked="checked"<?php endif; ?>value="1" />是否新窗口</label>
						</td>
					</tr>
					<tr>
						<td align="right">频道栏目</td>
						<td>
							<select name="cid" class="input input-small" style="width:200px;">
								<?php if(is_array($cate)): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["cid"]); ?>" <?php if($vo['cid'] == $_GET['cid']): ?>selected="selected"<?php endif; if($vo['cattype'] == 2): ?>disabled="disabled"<?php endif; ?>><?php echo ($vo["_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">发布者</td>
						<td>
							<input type="text" name="uid" value="<?php echo ($field["_author"]); ?>" class="input input-small" size="45"/>
							<span>请输入用户账户,不要输入昵称。</span>
						</td>
					</tr>
					<tr>
						<td align="right">SEO标题</td>
						<td><input type="text" name="seo_title" value="<?php echo ($field["seo_title"]); ?>" class="input input-small" size="45"/></td>
					</tr>
					<tr>
						<td align="right">关键词</td>
						<td><input type="text" name="keywords" value="<?php echo ($field["keywords"]); ?>" class="input input-small" size="45"/></td>
					</tr>
					<tr>
						<td align="right">视频预览</td>
						<td>
							<div class="line">
								<div class="x5">
									<img src="http://www.197c.com/data/attachment/block/b2/b232cbf90d4f1b6dc71e4ed89b1d7fc8.jpg" width="400" height="250" border="0" />
								</div>
								<div class="x6 video-padding">
									<input type="file" id="file_upload" name="video_path" />
									<button type="button" OnClick="javascript:$('#file_upload').uploadify('upload')" class="button bg-sub radius-none Edit-Video-Button">开始上传</button>
									<script type="text/javascript">
									$(document).ready(function() {
										$(function(){
											$("#file_upload").uploadify({
											'debug'			:true,		// 是否开启调试模式
											'buttonText'	:'选择视频', // 上传按钮文字
											'auto'			: false, // 自动上传，true自动上传,false不自动上传
											'swf'           : '/PHPUnion/Home/Lib/uploadify/uploadify.swf', // swf插件地址
											'uploader'      : '<?php echo U("Admin/Video/UploadVideo");?>', // 上传处理脚本
											'fileTypeExts'	:'*.mp4;*.avi;*.flv;*.wmv;*.3gp;*.mpg;*.rmvb;*.mov', // 允许上传格式
											'fileTypeDesc'	:'Video File',	// 上传类型描述
											'fileSizeLimit'	:'1024MB',		// 上传限制大小
											'method'		:'POST',		// 数据发送类型
											'multi'			:false,			// 是否允许多文件
											'uploadLimit'	:1,				// 文件上传数量
											'queueSizeLimit':1,				// 一次最大上传文件数量
											// 返回一个错误，选择文件的时候触发
											 'onSelectError':function(file, errorCode, errorMsg){
											 	switch(errorCode){
											 		case -100:
											 		alert("上传的文件数量已经超出系统限制的"+$('#file_upload').uploadify('settings','queueSizeLimit')+"个文件！");
											 		break;
											 		case -110:
											 		alert("文件 ["+file.name+"] 大小超出系统限制的"+$('#file_upload').uploadify('settings','fileSizeLimit')+"大小！");
											 		break;
											 		case -120:
											 		alert("文件 ["+file.name+"] 大小异常！");
											 		break;
											 		case -130:
											 		alert("文件 ["+file.name+"] 类型不正确！");
											 		break;
											 	}
											 },
											 // 检测FLASH失败调用
											 'onFallback':function(){
											 	alert("您未安装FLASH控件，无法上传视频！请安装FLASH控件后再试。");
											 },
											 // 上传到服务器，服务器返回相应信息到data里
											 'onUploadSuccess':function(file, data, response){
											 	$("#file_upload").val(file_path);
											 }
										});
										});
										});
									</script>
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td align="right">视频简介</td>
						<td><textarea name="content" rows="10" style="width:100%;" class="input input-small"><?php echo ($field["content"]); ?></textarea></td>
					</tr>
				</table>
			</div>
			<!-- 左侧 End -->

			<!-- 右侧 -->
			<div class="x4 padding-left">
				<table class="table table-hover table-bordered">
					<tr class="bg">
						<td>视频信息</td>
					</tr>
					<tr>
						<td>
							<div class="line">
								<div class="x5"><img src="<?php echo ($field["thumb"]); ?>" width="180" height="100" /></div>
								<div class="x7">
									<ul class="list-unstyle height">
										<li>分辨率：<?php echo ($field["resolution"]); ?></li>
										<li>视频时长：<?php echo ($field["video_time"]); ?></li>
										<li>视频格式：<?php echo ($field["postfix"]); ?></li>
									</ul>
								</div>
							</div>
						</td>
					</tr>
					<tr class="bg">
						<td>播放次数</td>
					</tr>
					<tr>
						<td><input type="text" name="click" value="<?php echo ($field["click"]); ?>" class="input input-small" size="45"/></td>
					</tr>
					<tr class="bg">
						<td>状态</td>
					</tr>
					<tr>
						<td>
							<label><input type="radio" name="video_status" <?php if($field['video_status'] == 0): ?>checked="checked"<?php endif; ?> value="0"/> 未审核</label>
							<label><input type="radio" name="video_status" <?php if($field['video_status'] == 1): ?>checked="checked"<?php endif; ?> value="1"/> 已审核</label>
						</td>
					</tr>
					<tr class="bg">
						<td>Tag标签</td>
					</tr>
					<tr>
						<td><input type="text" name="tag" value="<?php echo ($field["tag"]); ?>" class="input input-small" size="45" /></td>
					</tr>
					<tr class="bg">
						<td>推荐位</td>
					</tr>
					<tr>
						<td>
							<?php if(is_array($flag)): $i = 0; $__LIST__ = $flag;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><label><input type="checkbox" name="fid[]" value="<?php echo ($vo["fid"]); ?>"/> <?php echo ($vo["fname"]); ?></label><?php endforeach; endif; else: echo "" ;endif; ?>
						</td>
					</tr>
					<tr class="bg">
						<td>访问方式</td>
					</tr>
					<tr>
						<td>
							<label><input type="radio" name="url_type" <?php if($field['url_type'] == 1): ?>checked="checked"<?php endif; ?> value="1">静态访问</label>
							<label><input type="radio" name="url_type" <?php if($field['url_type'] == 2): ?>checked="checked"<?php endif; ?>  value="2">动态访问</label>
							<label><input type="radio" name="url_type" <?php if($field['url_type'] == 3): ?>checked="checked"<?php endif; ?>  value="3">继承栏目</label>
						</td>
					</tr>
					<tr class="bg">
						<td>发布时间</td>
					</tr>
					<tr>
						<td><input type="text" name="" value="<?php echo (date('Y-m-d H:i:s',$field["addtime"])); ?>" class="input input-small" size="45" /></td>
					</tr>
					<tr class="bg">
						<td>更新时间</td>
					</tr>
					<tr>
						<td><input type="text" name="" value="<?php echo (date('Y-m-d H:i:s',$field["updatetime"])); ?>" class="input input-small" size="45" /></td>
					</tr>
				</table>
			</div>
			<!-- 右侧 End -->
		</div>
		<div class="border margin-little-top padding">
			<button type="submit" class="button radius-none bg-main">
				提交发布
			</button>
		</div>
	</form>
</div>
</body>
</html>